package com.chixing.day05;

public class Work2 {
    public static void main(String[] args) {
        int[][] arr = new int[5][5];
        for(int i=0; i<5;i++){
            for (int j=0;j<5;j++){
                if(i==0&&j!=0) {
                    arr[i ][j] =0;
                }
                else if (j==0) {
                    arr[i][j]=1;
                } else {
                    arr[i][j] = arr[i - 1][j] + arr[i - 1][j - 1];
                }
                if (arr[i][j]<1){
                    System.out.print(" ");
                }
                else {
                    System.out.print(arr[i][j]);
                }
            }
            System.out.println(" ");
        }
    }
}
